<div markdown="1">

1.	Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. One way to do this is to <a href="{{ page.baseurl }}/install-gde/prereq/file-sys-perms-over.html">切换到Magento文件所有者身份</a>.

	If you use the bash shell, you can also use the following syntax to switch to the Magento文件系统所有者 and enter the command at the same time:

		su <Magento文件系统所有者> -s /bin/bash -c <command>

	If the Magento文件系统所有者 does not allow logins you can do the following:
	
		sudo -u <Magento文件系统所有者>  <command>
2.	To run Magento commands from any directory, add `<your Magento install dir>/bin` to your system `PATH`.

	Because shells have differing syntax, consult a reference like <a href="http://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables" target="_blank">unix.stackexchange.com</a>.

	bash shell example for CentOS:
		
		export PATH=$PATH:/var/www/html/magento2/bin

<div class="bs-callout bs-callout-info" id="info">
<span class="glyphicon-class">
  <p>You can also run the commands in the following ways:</p>
<ul><li><code>cd &lt;你的Magento的安装目录>/bin</code> and run them as <code>./magento &lt;command name></code></li>
<li><code>php &lt;你的Magento的安装目录>/bin/magento &lt;command name></code></li></ul>
<p><code>&lt;你的Magento的安装目录></code> is a subdirectory of your web server's docroot. Need help locating the docroot? Click <a href="{{ page.baseurl }}/install-gde/basics/basics_docroot.html">here</a>.</p></span>
</div>
